package com.hiwhitley.himei.module.video;

import android.content.Context;
import android.content.Intent;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewCompat;
import android.support.v4.view.ViewPager;
import android.support.v7.widget.Toolbar;

import com.hiwhitley.himei.R;
import com.hiwhitley.himei.app.base.BaseActivity;
import com.hiwhitley.himei.widget.CustomTextView;

import butterknife.BindView;

/**
 * Created by hiwhitley on 2016/9/28.
 */

public class FindMoreInfoActivity extends BaseActivity {
    @BindView(R.id.video_toolbar)
    Toolbar mToolbar;
    @BindView(R.id.vp_find_more_info)
    ViewPager mFindMoreInfoViewPager;
    @BindView(R.id.sliding_tabs)
    TabLayout mSlidingTabs;

    @BindView(R.id.custom_text_view)
    CustomTextView mCustomTextView;
    private static final String TAG_TITLE = "title";
    public static final String TRAN_TAG = "tag";


    public static Intent newIntent(Context context, String title) {
        Intent intent = new Intent(context, FindMoreInfoActivity.class);
        intent.putExtra(TAG_TITLE, title);
        return intent;

    }

    @Override
    protected int getContentViewId() {
        return R.layout.activity_find_more_info;
    }

    @Override
    protected void init() {

        String title = getIntent().getStringExtra(TAG_TITLE);
        mCustomTextView.setText(title);

        setSupportActionBar(mToolbar);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        getSupportActionBar().setDisplayShowTitleEnabled(false);

        mFindMoreInfoViewPager.setAdapter(new FindMorePagerAdapter(getSupportFragmentManager(), title));
        mSlidingTabs.setupWithViewPager(mFindMoreInfoViewPager);
    }

    @Override
    protected void setListeners() {
        ViewCompat.setTransitionName(mFindMoreInfoViewPager, TRAN_TAG);
    }
}
